<style>
    .layui-form-label{width:130px;margin-left: 0px;}
    .layui-form{height: 240px;margin-top: 35px;}
    .layui-input-block{margin-left: 160px!important;margin-top:10px;}
    .layui-textarea{height: 120px!important;}.layui-form-text{display: none;}
     .client_ordernum_select{width:280px;}
</style>
<form class="layui-form"  method="post" id="editForm">
    <input type="hidden" name="ids_str" class="ids_strs" value="">
    <input type="hidden" name="type" class="is_type_outIn" value="">

    <div class="layui-inline">
        <div class="layui-form-item">
            <label class="layui-form-label">展示地址名称：</label>
            <div class="layui-input-block">
                <input type="text" name="address"  value=""  placeholder="请输入展示地址名称" class="layui-input client_ordernum_select">
            </div>
        </div>
    </div>

    <div class="pop-bottom-bar">
        <input type="hidden" class="field-id" name="id">
        <button type="submit" class="layui-btn layui-btn-normal" lay-submit="" lay-filter="formSubmit3" >确定</button>
        <a href="javascript:parent.layui.layer.closeAll();" class="layui-btn layui-btn-primary ml10">取消</a>
    </div>
</form>


{include file="system@block/layui" /}

<script type="text/javascript">
    layui.use(['jquery', 'layer', 'form'], function() {
        var $ = layui.jquery;
        var layer = layui.layer;
        var form = layui.form;
        //监听提交
        form.on('submit(formSubmit3)', function(data){
            var address=$('.client_ordernum_select').val();
            if(address =='' ){
                layer.msg('不能为空', {time: 1800, icon: 2});
                return false;
            }
            $.post("{:url('addAddress')}", {address:address}, function (res) {
                if (res.code == 1) {
                    layer.msg(res.msg, {time: 1800, icon: 1}, function () {
                        var index = parent.layer.getFrameIndex(window.name);
                        parent.layer.close(index);
                        parent.location.reload();
                    });
                } else {
                    layer.msg(res.msg, {time: 1800, icon: 2});
                }
            }, 'json');

            return false;
        });

    });

</script>